/*
 * SchoolmanagementView.java
 */

package schoolmanagement;

import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import schoolmanagement.controller.*;
import schoolmanagement.dialogs.JPasswordChangeDialog;
import schoolmanagement.entity.SmPerson;
/**
 * The application's main frame.
 */
public class SchoolmanagementView extends FrameView {

    static private SchoolmanagementView instance;
    static public SchoolmanagementView getInstance() {
        return instance;
    }
    
    static void setInstance( SchoolmanagementView inst ) {
        instance = inst;
    }
    
    public void ReloadFields() {
        SmPerson smp = User.GetUserPerson();
        personDetailsControl1.setAddress(smp.getPerAdress());
        /*
        jtbSurnameNameDetails.setText(smp.getPerSurname());
        jtbNameDetails.setText(smp.getPerName());
        jtbAddressDetail.setText(smp.getPerAdress());
        jtbPeselForDetail.setText(Integer.toString( smp.getPerPesel() ) );
        jtbPhoneDetail.setText(Integer.toString( smp.getPerPhone()) );
        jtbNipForDetail.setText(Integer.toString( smp.getPerNip()) );
        */
        jLblLoggedAs.setText(smp.getPerName() + " " + smp.getPerSurname() );
    }
    
    public SchoolmanagementView(SingleFrameApplication app) {
        super(app);

        instance = null;
        
        initComponents();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        aboutBox = new JDialog();
        statusAnimationLabel = new JLabel();
        statusMessageLabel = new JLabel();
        
        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName)) {
                    if (!busyIconTimer.isRunning()) {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                } else if ("done".equals(propertyName)) {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                } else if ("message".equals(propertyName)) {
                    String text = (String)(evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName)) {
                    int value = (Integer)(evt.getNewValue());
                }
            }
        });
        
        ReloadFields();
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = SchoolmanagementApp.getApplication().getMainFrame();
            aboutBox = new SchoolmanagementAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        SchoolmanagementApp.getApplication().show(aboutBox);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        jtabMain = new javax.swing.JTabbedPane();
        jpanelMessageList = new javax.swing.JPanel();
        jSeparator1 = new javax.swing.JSeparator();
        jScrollPane3 = new javax.swing.JScrollPane();
        jtbMessageBody = new javax.swing.JTextArea();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtblMessageList = new javax.swing.JTable();
        jbtnDeleteMessages = new javax.swing.JButton();
        jpanelSendMessage = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTextArea2 = new javax.swing.JTextArea();
        jrbtMsgTypeIndividual = new javax.swing.JRadioButton();
        jrbtMsgTypeGroup = new javax.swing.JRadioButton();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jlstGroups = new javax.swing.JList();
        jScrollPane5 = new javax.swing.JScrollPane();
        jlstRecpients = new javax.swing.JList();
        jSeparator2 = new javax.swing.JSeparator();
        jbtnSendMessage = new javax.swing.JButton();
        jpanelScheldue = new javax.swing.JPanel();
        jpanelClassSelect = new javax.swing.JPanel();
        jcbSelectClass = new javax.swing.JComboBox();
        jLabel24 = new javax.swing.JLabel();
        jScrollPane8 = new javax.swing.JScrollPane();
        jtblScheldue = new javax.swing.JTable();
        jpanelLessonEdit = new javax.swing.JPanel();
        jcbPickLesson = new javax.swing.JComboBox();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jcbPickTeacher = new javax.swing.JComboBox();
        jbtnApplyLessonEditChanges = new javax.swing.JButton();
        jpanelNotes = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        jtblPupilNotes = new javax.swing.JTable();
        jpanelProporties = new javax.swing.JPanel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jcbPickSubjectForNotes = new javax.swing.JComboBox();
        jcbPickClassForNotes = new javax.swing.JComboBox();
        jLabel22 = new javax.swing.JLabel();
        jcbPickTeacherForNotes = new javax.swing.JComboBox();
        jpanelPersonalData = new javax.swing.JPanel();
        jpanelSearchCriteria = new javax.swing.JPanel();
        jrbtSearchName = new javax.swing.JRadioButton();
        jrbtSearchForGroup = new javax.swing.JRadioButton();
        jrbtSearchForClass = new javax.swing.JRadioButton();
        jtbNameForSearch = new javax.swing.JTextField();
        jcbPickGroupForSearch = new javax.swing.JComboBox();
        jcbPickClassForSearch = new javax.swing.JComboBox();
        jbtnStartSearch = new javax.swing.JButton();
        jScrollPane6 = new javax.swing.JScrollPane();
        jList3 = new javax.swing.JList();
        jLabel11 = new javax.swing.JLabel();
        jpanelPasswdChange = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jpassfieldActualPasswd = new javax.swing.JPasswordField();
        jpassfieldNewPasswd = new javax.swing.JPasswordField();
        jpassfieldRetypePasswd = new javax.swing.JPasswordField();
        jbtnShowMyDetails = new javax.swing.JButton();
        jbtnChangePassword = new javax.swing.JButton();
        personDetailsControl1 = new schoolmanagement.controls.PersonDetailsControl();
        jLabel1 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel29 = new javax.swing.JLabel();
        jLblLoggedAs = new javax.swing.JLabel();
        jbtnLogout = new javax.swing.JButton();
        jbtnProfile = new javax.swing.JButton();
        jbtgrpMessageRecpGroupType = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();

        mainPanel.setName("mainPanel"); // NOI18N
        mainPanel.addContainerListener(new java.awt.event.ContainerAdapter() {
            public void componentRemoved(java.awt.event.ContainerEvent evt) {
                mainPanelComponentRemoved(evt);
            }
        });

        jtabMain.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
        jtabMain.setName("jtabMain"); // NOI18N
        jtabMain.addContainerListener(new java.awt.event.ContainerAdapter() {
            public void componentRemoved(java.awt.event.ContainerEvent evt) {
                jtabMainComponentRemoved(evt);
            }
        });

        jpanelMessageList.setName("jpanelMessageList"); // NOI18N

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator1.setName("jSeparator1"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        jtbMessageBody.setColumns(20);
        jtbMessageBody.setLineWrap(true);
        jtbMessageBody.setRows(5);
        jtbMessageBody.setWrapStyleWord(true);
        jtbMessageBody.setName("jtbMessageBody"); // NOI18N
        jScrollPane3.setViewportView(jtbMessageBody);

        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel2.setText("Od:"); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel3.setText("Data:"); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel4.setText("Temat:"); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel5.setText("DyRektor"); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setText("wczoraj"); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jLabel7.setText("W Europie brakuje informatyków, chcą min. 10 tys. zł"); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jtblMessageList.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Data", "Nadawca", "Tytuł", "X"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Boolean.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jtblMessageList.setName("jtblMessageList"); // NOI18N
        jScrollPane1.setViewportView(jtblMessageList);
        jtblMessageList.getColumnModel().getColumn(3).setResizable(false);
        jtblMessageList.getColumnModel().getColumn(3).setPreferredWidth(30);

        jbtnDeleteMessages.setText("Usuń zaznaczone wiadomości"); // NOI18N
        jbtnDeleteMessages.setName("jbtnDeleteMessages"); // NOI18N
        jbtnDeleteMessages.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnDeleteMessagesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jpanelMessageListLayout = new javax.swing.GroupLayout(jpanelMessageList);
        jpanelMessageList.setLayout(jpanelMessageListLayout);
        jpanelMessageListLayout.setHorizontalGroup(
            jpanelMessageListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelMessageListLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelMessageListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE)
                    .addComponent(jbtnDeleteMessages, javax.swing.GroupLayout.DEFAULT_SIZE, 240, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpanelMessageListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 476, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jpanelMessageListLayout.createSequentialGroup()
                        .addGroup(jpanelMessageListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpanelMessageListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        jpanelMessageListLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel5, jLabel6, jLabel7});

        jpanelMessageListLayout.setVerticalGroup(
            jpanelMessageListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpanelMessageListLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelMessageListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 506, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpanelMessageListLayout.createSequentialGroup()
                        .addGroup(jpanelMessageListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpanelMessageListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpanelMessageListLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(jLabel7))
                        .addGap(11, 11, 11)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 441, Short.MAX_VALUE))
                    .addGroup(jpanelMessageListLayout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jbtnDeleteMessages)))
                .addContainerGap())
        );

        jtabMain.addTab("Skrzynka odbiorcza", jpanelMessageList);

        jpanelSendMessage.setName("jpanelSendMessage"); // NOI18N

        jScrollPane4.setName("jScrollPane4"); // NOI18N

        jTextArea2.setColumns(20);
        jTextArea2.setLineWrap(true);
        jTextArea2.setRows(5);
        jTextArea2.setWrapStyleWord(true);
        jTextArea2.setName("jTextArea2"); // NOI18N
        jScrollPane4.setViewportView(jTextArea2);

        jbtgrpMessageRecpGroupType.add(jrbtMsgTypeIndividual);
        jrbtMsgTypeIndividual.setText("Indywidualna"); // NOI18N
        jrbtMsgTypeIndividual.setName("jrbtMsgTypeIndividual"); // NOI18N

        jbtgrpMessageRecpGroupType.add(jrbtMsgTypeGroup);
        jrbtMsgTypeGroup.setText("Zbiorowa"); // NOI18N
        jrbtMsgTypeGroup.setName("jrbtMsgTypeGroup"); // NOI18N

        jLabel8.setText("Rodzaj wiadomości:"); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        jLabel9.setText("Grupa:"); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        jLabel10.setName("jLabel10"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jlstGroups.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Dyrekcja", "Nauczyciele", "Pracownicy", "Uczniowie" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jlstGroups.setName("jlstGroups"); // NOI18N
        jScrollPane2.setViewportView(jlstGroups);

        jScrollPane5.setName("jScrollPane5"); // NOI18N

        jlstRecpients.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jlstRecpients.setName("jlstRecpients"); // NOI18N
        jScrollPane5.setViewportView(jlstRecpients);

        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator2.setName("jSeparator2"); // NOI18N

        jbtnSendMessage.setText("Wyślij wiadomość"); // NOI18N
        jbtnSendMessage.setName("jbtnSendMessage"); // NOI18N

        javax.swing.GroupLayout jpanelSendMessageLayout = new javax.swing.GroupLayout(jpanelSendMessage);
        jpanelSendMessage.setLayout(jpanelSendMessageLayout);
        jpanelSendMessageLayout.setHorizontalGroup(
            jpanelSendMessageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelSendMessageLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelSendMessageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jbtnSendMessage, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)
                    .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpanelSendMessageLayout.createSequentialGroup()
                        .addComponent(jrbtMsgTypeIndividual)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrbtMsgTypeGroup))
                    .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpanelSendMessageLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE))
                    .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 602, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jpanelSendMessageLayout.setVerticalGroup(
            jpanelSendMessageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelSendMessageLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelSendMessageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 506, Short.MAX_VALUE)
                    .addGroup(jpanelSendMessageLayout.createSequentialGroup()
                        .addComponent(jbtnSendMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel8)
                        .addGap(18, 18, 18)
                        .addGroup(jpanelSendMessageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jrbtMsgTypeIndividual)
                            .addComponent(jrbtMsgTypeGroup))
                        .addGap(18, 18, 18)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel10)
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE))
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 506, Short.MAX_VALUE))
                .addContainerGap())
        );

        jtabMain.addTab("Wyślij wiadomość", jpanelSendMessage);

        jpanelScheldue.setName("jpanelScheldue"); // NOI18N

        jpanelClassSelect.setBorder(javax.swing.BorderFactory.createTitledBorder("Wybór klasy"));
        jpanelClassSelect.setName("jpanelClassSelect"); // NOI18N

        jcbSelectClass.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Klasa 2A" }));
        jcbSelectClass.setName("jcbSelectClass"); // NOI18N

        jLabel24.setText("Klasa:"); // NOI18N
        jLabel24.setName("jLabel24"); // NOI18N

        javax.swing.GroupLayout jpanelClassSelectLayout = new javax.swing.GroupLayout(jpanelClassSelect);
        jpanelClassSelect.setLayout(jpanelClassSelectLayout);
        jpanelClassSelectLayout.setHorizontalGroup(
            jpanelClassSelectLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpanelClassSelectLayout.createSequentialGroup()
                .addGap(45, 45, 45)
                .addComponent(jLabel24)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jcbSelectClass, 0, 182, Short.MAX_VALUE)
                .addContainerGap())
        );
        jpanelClassSelectLayout.setVerticalGroup(
            jpanelClassSelectLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelClassSelectLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelClassSelectLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jcbSelectClass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel24))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        jScrollPane8.setName("jScrollPane8"); // NOI18N

        jtblScheldue.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null}
            },
            new String [] {
                "Godzina", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jtblScheldue.setName("jtblScheldue"); // NOI18N
        jtblScheldue.setRowHeight(22);
        jtblScheldue.setRowSelectionAllowed(false);
        jtblScheldue.getTableHeader().setReorderingAllowed(false);
        jScrollPane8.setViewportView(jtblScheldue);

        jpanelLessonEdit.setBorder(javax.swing.BorderFactory.createTitledBorder("Edytuj lekcję"));
        jpanelLessonEdit.setName("jpanelLessonEdit"); // NOI18N

        jcbPickLesson.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Matematyka" }));
        jcbPickLesson.setName("jcbPickLesson"); // NOI18N

        jLabel27.setText("Przedmiot:"); // NOI18N
        jLabel27.setName("jLabel27"); // NOI18N

        jLabel28.setText("Nauczyciel:"); // NOI18N
        jLabel28.setName("jLabel28"); // NOI18N

        jcbPickTeacher.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Kowalski Janusz" }));
        jcbPickTeacher.setName("jcbPickTeacher"); // NOI18N

        jbtnApplyLessonEditChanges.setText("Zatwierdź zmiany"); // NOI18N
        jbtnApplyLessonEditChanges.setName("jbtnApplyLessonEditChanges"); // NOI18N

        javax.swing.GroupLayout jpanelLessonEditLayout = new javax.swing.GroupLayout(jpanelLessonEdit);
        jpanelLessonEdit.setLayout(jpanelLessonEditLayout);
        jpanelLessonEditLayout.setHorizontalGroup(
            jpanelLessonEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelLessonEditLayout.createSequentialGroup()
                .addGap(89, 89, 89)
                .addGroup(jpanelLessonEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel28)
                    .addComponent(jLabel27))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpanelLessonEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jbtnApplyLessonEditChanges, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                    .addComponent(jcbPickLesson, 0, 188, Short.MAX_VALUE)
                    .addComponent(jcbPickTeacher, 0, 188, Short.MAX_VALUE))
                .addContainerGap())
        );
        jpanelLessonEditLayout.setVerticalGroup(
            jpanelLessonEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelLessonEditLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelLessonEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27)
                    .addComponent(jcbPickLesson, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpanelLessonEditLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jcbPickTeacher, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28))
                .addGap(18, 18, 18)
                .addComponent(jbtnApplyLessonEditChanges)
                .addContainerGap(28, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jpanelScheldueLayout = new javax.swing.GroupLayout(jpanelScheldue);
        jpanelScheldue.setLayout(jpanelScheldueLayout);
        jpanelScheldueLayout.setHorizontalGroup(
            jpanelScheldueLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelScheldueLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelScheldueLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 787, Short.MAX_VALUE)
                    .addComponent(jpanelClassSelect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jpanelLessonEdit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jpanelScheldueLayout.setVerticalGroup(
            jpanelScheldueLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelScheldueLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jpanelClassSelect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 228, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(jpanelLessonEdit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(22, 22, 22))
        );

        jtabMain.addTab("Plan zajęć", jpanelScheldue);

        jpanelNotes.setName("jpanelNotes"); // NOI18N

        jScrollPane7.setName("jScrollPane7"); // NOI18N

        jtblPupilNotes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Nazwisko ucznia", "Oceny"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jtblPupilNotes.setName("jtblPupilNotes"); // NOI18N
        jtblPupilNotes.getTableHeader().setReorderingAllowed(false);
        jScrollPane7.setViewportView(jtblPupilNotes);

        jpanelProporties.setBorder(javax.swing.BorderFactory.createTitledBorder("Wybór"));
        jpanelProporties.setName("jpanelProporties"); // NOI18N

        jLabel20.setText("Przedmiot:"); // NOI18N
        jLabel20.setName("jLabel20"); // NOI18N

        jLabel21.setText("Klasa:"); // NOI18N
        jLabel21.setName("jLabel21"); // NOI18N

        jcbPickSubjectForNotes.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "J. Polski", "Matematyka" }));
        jcbPickSubjectForNotes.setName("jcbPickSubjectForNotes"); // NOI18N

        jcbPickClassForNotes.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Klasa 2A" }));
        jcbPickClassForNotes.setName("jcbPickClassForNotes"); // NOI18N

        jLabel22.setText("Nauczyciel:"); // NOI18N
        jLabel22.setName("jLabel22"); // NOI18N

        jcbPickTeacherForNotes.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Kowalski Janusz" }));
        jcbPickTeacherForNotes.setName("jcbPickTeacherForNotes"); // NOI18N

        javax.swing.GroupLayout jpanelProportiesLayout = new javax.swing.GroupLayout(jpanelProporties);
        jpanelProporties.setLayout(jpanelProportiesLayout);
        jpanelProportiesLayout.setHorizontalGroup(
            jpanelProportiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelProportiesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelProportiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel22)
                    .addComponent(jLabel20)
                    .addComponent(jLabel21))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpanelProportiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jcbPickSubjectForNotes, javax.swing.GroupLayout.Alignment.TRAILING, 0, 178, Short.MAX_VALUE)
                    .addComponent(jcbPickTeacherForNotes, 0, 178, Short.MAX_VALUE)
                    .addComponent(jcbPickClassForNotes, 0, 178, Short.MAX_VALUE))
                .addContainerGap())
        );
        jpanelProportiesLayout.setVerticalGroup(
            jpanelProportiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpanelProportiesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelProportiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel22)
                    .addComponent(jcbPickTeacherForNotes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 56, Short.MAX_VALUE)
                .addGroup(jpanelProportiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpanelProportiesLayout.createSequentialGroup()
                        .addComponent(jcbPickSubjectForNotes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(57, 57, 57)
                        .addGroup(jpanelProportiesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jcbPickClassForNotes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel21)))
                    .addComponent(jLabel20))
                .addGap(66, 66, 66))
        );

        javax.swing.GroupLayout jpanelNotesLayout = new javax.swing.GroupLayout(jpanelNotes);
        jpanelNotes.setLayout(jpanelNotesLayout);
        jpanelNotesLayout.setHorizontalGroup(
            jpanelNotesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpanelNotesLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jpanelProporties, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 497, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jpanelNotesLayout.setVerticalGroup(
            jpanelNotesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelNotesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelNotesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jpanelProporties, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 506, Short.MAX_VALUE))
                .addContainerGap())
        );

        jtabMain.addTab("Oceny", jpanelNotes);

        jpanelPersonalData.setName("jpanelPersonalData"); // NOI18N

        jpanelSearchCriteria.setBorder(javax.swing.BorderFactory.createTitledBorder("Wyszukuj względem"));
        jpanelSearchCriteria.setName("jpanelSearchCriteria"); // NOI18N

        buttonGroup2.add(jrbtSearchName);
        jrbtSearchName.setText("Nazwiska"); // NOI18N
        jrbtSearchName.setName("jrbtSearchName"); // NOI18N

        buttonGroup2.add(jrbtSearchForGroup);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(schoolmanagement.SchoolmanagementApp.class).getContext().getResourceMap(SchoolmanagementView.class);
        jrbtSearchForGroup.setText(resourceMap.getString("jrbtSearchForGroup.text")); // NOI18N
        jrbtSearchForGroup.setName("jrbtSearchForGroup"); // NOI18N

        buttonGroup2.add(jrbtSearchForClass);
        jrbtSearchForClass.setText("Klasy"); // NOI18N
        jrbtSearchForClass.setName("jrbtSearchForClass"); // NOI18N

        jtbNameForSearch.setName("jtbNameForSearch"); // NOI18N

        jcbPickGroupForSearch.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Dyrekcja", "Nauczyciele", "Pracownicy", "Uczniowie" }));
        jcbPickGroupForSearch.setName("jcbPickGroupForSearch"); // NOI18N

        jcbPickClassForSearch.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Klasa 2A", "Klasa 2B", "Klasa 3A", "Klasa 3B" }));
        jcbPickClassForSearch.setName("jcbPickClassForSearch"); // NOI18N

        jbtnStartSearch.setText("Wyszukuj"); // NOI18N
        jbtnStartSearch.setName("jbtnStartSearch"); // NOI18N

        javax.swing.GroupLayout jpanelSearchCriteriaLayout = new javax.swing.GroupLayout(jpanelSearchCriteria);
        jpanelSearchCriteria.setLayout(jpanelSearchCriteriaLayout);
        jpanelSearchCriteriaLayout.setHorizontalGroup(
            jpanelSearchCriteriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelSearchCriteriaLayout.createSequentialGroup()
                .addGroup(jpanelSearchCriteriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpanelSearchCriteriaLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jpanelSearchCriteriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jpanelSearchCriteriaLayout.createSequentialGroup()
                                .addComponent(jrbtSearchForClass)
                                .addGap(18, 18, 18)
                                .addComponent(jcbPickClassForSearch, 0, 138, Short.MAX_VALUE))
                            .addGroup(jpanelSearchCriteriaLayout.createSequentialGroup()
                                .addGroup(jpanelSearchCriteriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jrbtSearchName)
                                    .addComponent(jrbtSearchForGroup))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jpanelSearchCriteriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jcbPickGroupForSearch, 0, 136, Short.MAX_VALUE)
                                    .addComponent(jtbNameForSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)))))
                    .addComponent(jbtnStartSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE))
                .addContainerGap())
        );
        jpanelSearchCriteriaLayout.setVerticalGroup(
            jpanelSearchCriteriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelSearchCriteriaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelSearchCriteriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jrbtSearchName)
                    .addComponent(jtbNameForSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jpanelSearchCriteriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jrbtSearchForGroup)
                    .addComponent(jcbPickGroupForSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jpanelSearchCriteriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jrbtSearchForClass)
                    .addComponent(jcbPickClassForSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
                .addComponent(jbtnStartSearch)
                .addContainerGap())
        );

        jScrollPane6.setName("jScrollPane6"); // NOI18N

        jList3.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jList3.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jList3.setName("jList3"); // NOI18N
        jScrollPane6.setViewportView(jList3);

        jLabel11.setText("Wyniki wyszukiwania:"); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        jpanelPasswdChange.setBorder(javax.swing.BorderFactory.createTitledBorder("Zmiana hasła"));
        jpanelPasswdChange.setName("jpanelPasswdChange"); // NOI18N

        jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel17.setText("Aktualne hasło:"); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel18.setText("Nowe hasło:"); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        jLabel19.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel19.setText("Nowe hasło (powtórnie):"); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N

        jpassfieldActualPasswd.setName("jpassfieldActualPasswd"); // NOI18N

        jpassfieldNewPasswd.setName("jpassfieldNewPasswd"); // NOI18N

        jpassfieldRetypePasswd.setName("jpassfieldRetypePasswd"); // NOI18N

        jbtnShowMyDetails.setText("Pokaż moje dane"); // NOI18N
        jbtnShowMyDetails.setName("jbtnShowMyDetails"); // NOI18N

        jbtnChangePassword.setText("Zmień hasło"); // NOI18N
        jbtnChangePassword.setName("jbtnChangePassword"); // NOI18N

        javax.swing.GroupLayout jpanelPasswdChangeLayout = new javax.swing.GroupLayout(jpanelPasswdChange);
        jpanelPasswdChange.setLayout(jpanelPasswdChangeLayout);
        jpanelPasswdChangeLayout.setHorizontalGroup(
            jpanelPasswdChangeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelPasswdChangeLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelPasswdChangeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpanelPasswdChangeLayout.createSequentialGroup()
                        .addGroup(jpanelPasswdChangeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jpanelPasswdChangeLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 88, Short.MAX_VALUE)
                                .addComponent(jLabel18))
                            .addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpanelPasswdChangeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jpassfieldNewPasswd, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)
                            .addComponent(jpassfieldRetypePasswd, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)
                            .addComponent(jbtnChangePassword, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpanelPasswdChangeLayout.createSequentialGroup()
                        .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpanelPasswdChangeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jbtnShowMyDetails)
                            .addComponent(jpassfieldActualPasswd, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE))))
                .addGap(119, 119, 119))
        );
        jpanelPasswdChangeLayout.setVerticalGroup(
            jpanelPasswdChangeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelPasswdChangeLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelPasswdChangeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jpassfieldActualPasswd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbtnShowMyDetails)
                .addGap(40, 40, 40)
                .addGroup(jpanelPasswdChangeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jpassfieldNewPasswd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpanelPasswdChangeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(jpassfieldRetypePasswd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbtnChangePassword)
                .addContainerGap(15, Short.MAX_VALUE))
        );

        personDetailsControl1.setName("personDetailsControl1"); // NOI18N

        javax.swing.GroupLayout jpanelPersonalDataLayout = new javax.swing.GroupLayout(jpanelPersonalData);
        jpanelPersonalData.setLayout(jpanelPersonalDataLayout);
        jpanelPersonalDataLayout.setHorizontalGroup(
            jpanelPersonalDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpanelPersonalDataLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelPersonalDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE)
                    .addComponent(jpanelSearchCriteria, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE))
                .addGroup(jpanelPersonalDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpanelPersonalDataLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jpanelPasswdChange, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jpanelPersonalDataLayout.createSequentialGroup()
                        .addGap(49, 49, 49)
                        .addComponent(personDetailsControl1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jpanelPersonalDataLayout.setVerticalGroup(
            jpanelPersonalDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelPersonalDataLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpanelPersonalDataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpanelPersonalDataLayout.createSequentialGroup()
                        .addComponent(personDetailsControl1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(57, 57, 57)
                        .addComponent(jpanelPasswdChange, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jpanelPersonalDataLayout.createSequentialGroup()
                        .addComponent(jpanelSearchCriteria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel11)
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE)))
                .addContainerGap())
        );

        jtabMain.addTab("Dane personalne", jpanelPersonalData);

        jLabel1.setFont(new java.awt.Font("Trebuchet MS", 1, 24));
        jLabel1.setForeground(new java.awt.Color(102, 51, 0));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        jLabel29.setFont(resourceMap.getFont("jLabel29.font")); // NOI18N
        jLabel29.setText("Jesteś zalogowany jako"); // NOI18N
        jLabel29.setName("jLabel29"); // NOI18N

        jLblLoggedAs.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLblLoggedAs.setForeground(new java.awt.Color(0, 153, 255));
        jLblLoggedAs.setText("Paweł Pawłowski"); // NOI18N
        jLblLoggedAs.setName("jLblLoggedAs"); // NOI18N

        jbtnLogout.setText("Wyloguj sie"); // NOI18N
        jbtnLogout.setName("jbtnLogout"); // NOI18N
        jbtnLogout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnLogoutActionPerformed(evt);
            }
        });

        jbtnProfile.setText("Moj profil"); // NOI18N
        jbtnProfile.setName("jbtnProfile"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel29)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLblLoggedAs)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 310, Short.MAX_VALUE)
                .addComponent(jbtnProfile, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jbtnLogout, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel29)
                    .addComponent(jLblLoggedAs)
                    .addComponent(jbtnLogout)
                    .addComponent(jbtnProfile))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, mainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, mainPanelLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtabMain, javax.swing.GroupLayout.PREFERRED_SIZE, 812, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(jtabMain, javax.swing.GroupLayout.DEFAULT_SIZE, 556, Short.MAX_VALUE)
                .addContainerGap())
        );

        setComponent(mainPanel);
    }// </editor-fold>//GEN-END:initComponents

    private void mainPanelComponentRemoved(java.awt.event.ContainerEvent evt) {//GEN-FIRST:event_mainPanelComponentRemoved
        // TODO add your handling code here:
    }//GEN-LAST:event_mainPanelComponentRemoved

    private void jtabMainComponentRemoved(java.awt.event.ContainerEvent evt) {//GEN-FIRST:event_jtabMainComponentRemoved
        // TODO add your handling code here:
}//GEN-LAST:event_jtabMainComponentRemoved

    private void jbtnLogoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnLogoutActionPerformed
        this.getFrame().setVisible(false);
        User.Logout();
        LoginJFrame.getInstance().setVisible(true);
}//GEN-LAST:event_jbtnLogoutActionPerformed

    private void jbtnDeleteMessagesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnDeleteMessagesActionPerformed
        JPasswordChangeDialog jpn = new JPasswordChangeDialog(this.getFrame(), false);
        jpn.setVisible(true);
        if(jpn.getResult())
        {
            
        }
    }//GEN-LAST:event_jbtnDeleteMessagesActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLblLoggedAs;
    private javax.swing.JList jList3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTextArea jTextArea2;
    private javax.swing.ButtonGroup jbtgrpMessageRecpGroupType;
    private javax.swing.JButton jbtnApplyLessonEditChanges;
    private javax.swing.JButton jbtnChangePassword;
    private javax.swing.JButton jbtnDeleteMessages;
    private javax.swing.JButton jbtnLogout;
    private javax.swing.JButton jbtnProfile;
    private javax.swing.JButton jbtnSendMessage;
    private javax.swing.JButton jbtnShowMyDetails;
    private javax.swing.JButton jbtnStartSearch;
    private javax.swing.JComboBox jcbPickClassForNotes;
    private javax.swing.JComboBox jcbPickClassForSearch;
    private javax.swing.JComboBox jcbPickGroupForSearch;
    private javax.swing.JComboBox jcbPickLesson;
    private javax.swing.JComboBox jcbPickSubjectForNotes;
    private javax.swing.JComboBox jcbPickTeacher;
    private javax.swing.JComboBox jcbPickTeacherForNotes;
    private javax.swing.JComboBox jcbSelectClass;
    private javax.swing.JList jlstGroups;
    private javax.swing.JList jlstRecpients;
    private javax.swing.JPanel jpanelClassSelect;
    private javax.swing.JPanel jpanelLessonEdit;
    private javax.swing.JPanel jpanelMessageList;
    private javax.swing.JPanel jpanelNotes;
    private javax.swing.JPanel jpanelPasswdChange;
    private javax.swing.JPanel jpanelPersonalData;
    private javax.swing.JPanel jpanelProporties;
    private javax.swing.JPanel jpanelScheldue;
    private javax.swing.JPanel jpanelSearchCriteria;
    private javax.swing.JPanel jpanelSendMessage;
    private javax.swing.JPasswordField jpassfieldActualPasswd;
    private javax.swing.JPasswordField jpassfieldNewPasswd;
    private javax.swing.JPasswordField jpassfieldRetypePasswd;
    private javax.swing.JRadioButton jrbtMsgTypeGroup;
    private javax.swing.JRadioButton jrbtMsgTypeIndividual;
    private javax.swing.JRadioButton jrbtSearchForClass;
    private javax.swing.JRadioButton jrbtSearchForGroup;
    private javax.swing.JRadioButton jrbtSearchName;
    private javax.swing.JTabbedPane jtabMain;
    private javax.swing.JTextArea jtbMessageBody;
    private javax.swing.JTextField jtbNameForSearch;
    private javax.swing.JTable jtblMessageList;
    private javax.swing.JTable jtblPupilNotes;
    private javax.swing.JTable jtblScheldue;
    private javax.swing.JPanel mainPanel;
    private schoolmanagement.controls.PersonDetailsControl personDetailsControl1;
    // End of variables declaration//GEN-END:variables

    

    //private javax.swing.JMenuBar menuBar;
    //private javax.swing.JProgressBar progressBar;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    //private javax.swing.JPanel statusPanel;
    
    private final Timer messageTimer;
    private final Timer busyIconTimer;
    private final Icon idleIcon;
    private final Icon[] busyIcons = new Icon[15];
    private int busyIconIndex = 0;

    private JDialog aboutBox;
}
